<template>
  <div class="cart">
    <nav-bar class="nav-bar">
      <div slot="center">购物车({{cartLength}})</div>
    </nav-bar>
    <CartList/>
    <cart-bottom-bar/>
  </div>
</template>

<script>
  import NavBar from "@/components/common/navbar/NavBar";
  import CartList from "@/views/cart/childComps/CartList";
  import CartBottomBar from "@/views/cart/childComps/CartBottomBar";

  // import { mapGetters } from 'vuex'

  export default {
    name: "Cart",
    components: {
      CartBottomBar,
      NavBar,
      CartList
    },
    computed: {
      /*...mapGetters(['cartLength','cartList'])*/
      cartLength() {
        return this.$store.state.cartList.length
      },
    },

  }
</script>

<style scoped>
  .nav-bar {
    background-color: var(--color-tint);
    color: #fff;
    font-weight: 700;
  }
</style>
